<template>
	<div id="coming">
		<ul>
			<li v-for="item in comingPlayData" :key="item.id">
				<div class="first">
					<img :src="item.img" alt="">
				</div>
				<div class="second">
					<p class="title">{{item.title}}</p>
					<p><span class="font-color">{{item.nums}}</span><span class="font-color">人想看</span></p>
					<p class="actors font-color">{{item.actors}}</p>
					<p class="font-color">未来30天内上映</p>
				</div>
				<div class="third">
					<button>预售</button>
				</div>
			</li>
		</ul>
	</div>
</template>

<script>
	export default{
		name: 'Coming',
		methods:{
			getComingPlayData(){
				var that = this;
				axios.get('/mock/comingPlayData.json')
				  .then(function (response) {
				    console.log(response);
					if(response.status == 200){
						if(response.data && response.data.comingPlayData){
							that.comingPlayData = response.data.comingPlayData;
						}
					}
				  })
				  .catch(function (error) {
				    console.log(error);
				  });
			}
		},
		created(){
			this.getComingPlayData();
		},
		data(){
			return{
				comingPlayData: []
			}
			
		}
	}
</script>

<style scoped>
	#coming{
		width: 100%;
		padding-bottom: 50px;
	}
	img{
		width: 80px;
	}
	div{
		float: left;
	}
	.first{
		width: 25%;
		margin-bottom: 8px;
	}
	.second{
		width: 58%;
	}
	.actors{
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.third{
		width: 15%;
		text-align: center;
		line-height: 75px;
	}
	li{
		overflow: hidden;
		margin: 10px;
		border-bottom: 1px solid #666;
	}
	.title{
		font-size: 18px;
		font-weight: bold;
	}
	p{
		line-height: 25px;
	}
	.font-color{
		color: #666;
	}
	button{
		background: dodgerblue;
		width: 45px;
		height: 30px;
		border: none;
		color: white;
		border-radius: 5px;
	}
</style>
